//
//  YXNavigationController.m
//  彩票
//
//  Created by mac on 15-3-27.
//  Copyright (c) 2015年 mac. All rights reserved.
//

#import "YXNavigationController.h"

@interface YXNavigationController ()

@end

@implementation YXNavigationController

//+(void)load
//{
//    
//}

+(void)initialize
{
    // appearance可以拿到UINavigationBar的外观对象，
    // UINavigationBar *bar=[UINavigationBar appearance];
    UINavigationBar *bar=[UINavigationBar appearanceWhenContainedIn:self, nil];
    
   [bar setBackgroundImage:[UIImage imageNamed:@"NavBar64"] forBarMetrics:UIBarMetricsDefault];
    // 设置导航栏字体
    NSMutableDictionary *titleFont = [NSMutableDictionary dictionary];
    titleFont[NSForegroundColorAttributeName] = [UIColor whiteColor];
    titleFont[NSFontAttributeName] = [UIFont systemFontOfSize:18];
    [bar setTitleTextAttributes:titleFont];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    
    if (self.viewControllers.count > 0) {
        
//        self.hidesBottomBarWhenPushed = YES;
        viewController.hidesBottomBarWhenPushed = YES;
        viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"NavBack"]style:UIBarButtonItemStylePlain target:self action:@selector(pop)];
    }
    [super pushViewController:viewController animated:YES];
}

- (void)pop
{
    [self popViewControllerAnimated:YES];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/


@end
